package com.acme.bankapp.exceptions;

import com.acme.bankapp.domain.bank.Account;

public class OverDraftLimitExceededException extends NotEnoughFundsException {
	private Account account;
	
	public OverDraftLimitExceededException() {
		super();
	}

	public OverDraftLimitExceededException(String message, Throwable cause) {
		super(message, cause);
	}

	public OverDraftLimitExceededException(String message) {
		super(message);
	}

	public OverDraftLimitExceededException(Throwable cause) {
		super(cause);
	}

	public OverDraftLimitExceededException(String message, Account account) {
		super(message);
		this.account = account;
	}
	
	public Account getAccount() {
		return account;
	}
	
	public double getMaxWithdraw() {
		if (account != null)
			return account.maximumAmountToWithdraw();
		else
			return Double.NaN;
	}
}
